package com.pyue.eam.regi.module.message.controller;

import cn.hutool.core.collection.CollUtil;
import com.pyue.eam.regi.module.message.entity.AppMsg;
import com.pyue.eam.regi.module.message.enums.MsgTypeEnum;
import com.pyue.eam.common.core.util.R;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 页面管理
 *
 * @date 2023-06-07 16:32:35
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/appMsg")
@Tag(description = "appMsg", name = "消息管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class AppMsgController {

    @GetMapping("myNotice")
    public R<List<AppMsg>> myNotice() {

        // 找到所有代办消息-


        List<AppMsg> msgList = CollUtil.newArrayList();
        MsgTypeEnum systemNotice = MsgTypeEnum.article_push;

        msgList.add(AppMsg.ofByEnum(systemNotice).setContent("第").setBizId("1"));
        msgList.add(AppMsg.ofByEnum(systemNotice).setContent("测试信息二").setBizId("2"));

        MsgTypeEnum taskCostEnum = MsgTypeEnum.task_cost;
        msgList.add(AppMsg.ofByEnum(taskCostEnum).setContent("测试信息三").setBizId("3"));

        return R.okList(msgList);
    }

}
